import QtQuick
import QtQuick.Controls

Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")

    ListView {
        id: listView
        anchors.fill: parent

        model: Qt.fontFamilies()

        delegate: ItemDelegate {
            text: modelData
            width: listView.width
            background: Rectangle {
                implicitWidth: listView.width
                implicitHeight: 30
                opacity: enabled ? 1 : 0.3
                color: (index % 2 == 0) ? "#d0d0d0" : "#ffffff"
            }
            onClicked: console.log("clicked:", modelData)

            required property string modelData
            required property int index
        }

        ScrollIndicator.vertical: ScrollIndicator { }
    }
}
